#pragma once

#include <common/DataPlaneUpdate.h>
#include <folly/MPMCPipeline.h>

#include <bdd.h>
#include <string>
#include <tbb/concurrent_vector.h>

namespace flashpp {

// using Pipeline = folly::MPMCPipeline<
//       int,
//       folly::MPMCPipelineStage<std::string, 2>,
//       folly::MPMCPipelineStage<int, 4>>;

struct Overwrite {
  HeaderSpace hs;
  std::string from;
  std::string to;
};

struct AtomicOverwrite {
  std::string device;
  tbb::concurrent_vector<std::pair<HeaderSpace, Port*>> overwrites;
  // std::vector<Overwrite> overwrites;
};

using Pipeline = folly::MPMCPipeline<
    std::shared_ptr<DataPlaneUpdate>,
    std::shared_ptr<DataPlaneUpdate>,
    std::shared_ptr<AtomicOverwrite>,
    std::shared_ptr<AtomicOverwrite>>;

} // namespace flashpp